import type { PageParam, PageResult } from '@vben/request';
import type { Dayjs } from 'dayjs';

import { requestClient } from '#/api/request';

export namespace ServicesApi {
  /** 店铺服务信息 */
  export interface Services {
    id: number; // 主键
    name: string; // 服务名称
    category: number; // 服务分类
    desc: string; // 服务说明
    price: number; // 服务价格
    cycle: number; // 服务周期
    status?: number; // 服务状态
  }
}

/** 查询店铺服务分页 */
export function getServicesPage(params: PageParam) {
  return requestClient.get<PageResult<ServicesApi.Services>>('/reservation/services/page', { params });
}

/** 查询店铺服务详情 */
export function getServices(id: number) {
  return requestClient.get<ServicesApi.Services>(`/reservation/services/get?id=${id}`);
}

/** 新增店铺服务 */
export function createServices(data: ServicesApi.Services) {
  return requestClient.post('/reservation/services/create', data);
}

/** 修改店铺服务 */
export function updateServices(data: ServicesApi.Services) {
  return requestClient.put('/reservation/services/update', data);
}

/** 删除店铺服务 */
export function deleteServices(id: number) {
  return requestClient.delete(`/reservation/services/delete?id=${id}`);
}

/** 导出店铺服务 */
export function exportServices(params: any) {
  return requestClient.download('/reservation/services/export-excel', params);
}

